<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/lyh/zpsc/zpsc_report.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/lyh/zpsc/zpsc_report.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '装配生产报表数据（LYH）',
                name: 'zpsc/zpsc_report',
                url: "/zpsc_report/",
                sortName: "date"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"depart":"","production_line":""});
            const searchFormOptions = ref([[{"title":"部门","field":"depart","type":"like"}],[{"title":"车间产线","field":"production_line","type":"like"}]]);
            const columns = ref([{field:'product_task',title:'生产任务',type:'string',width:130,align:'left',sort:true},
                       {field:'depart',title:'部门',type:'string',width:110,align:'left'},
                       {field:'production_line',title:'车间产线',type:'string',width:110,align:'left'},
                       {field:'status',title:'状态',type:'string',width:110,align:'left'},
                       {field:'product_num',title:'物料号',type:'string',width:110,align:'left'},
                       {field:'plan_count',title:'计划数量',type:'int',width:110,align:'left'},
                       {field:'fed_count',title:'投料数量',type:'int',width:110,align:'left'},
                       {field:'making_count',title:'在制数量',type:'int',width:110,align:'left'},
                       {field:'qualified_count',title:'合格数量',type:'int',width:110,align:'left'},
                       {field:'unqualified_count',title:'不合格数量',type:'int',width:110,align:'left'},
                       {field:'profit_and_loss',title:'盈亏',type:'decimal',width:110,align:'left'},
                       {field:'complete_rate',title:'完成率',type:'decimal',width:110,align:'left'},
                       {field:'unqualified_rate',title:'不合格率',type:'decimal',width:110,align:'left'},
                       {field:'remark',title:'备注',type:'string',width:150,align:'left'},
                       {field:'id',title:'id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'fed_achieve_rate',title:'投料达成率',type:'decimal',width:110,align:'left'},
                       {field:'plan_creator',title:'创建人',type:'string',width:120,align:'left'},
                       {field:'assign_devices',title:'分配设备',type:'string',width:120,align:'left'},
                       {field:'mes_createdate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'mes_date',title:'日期',type:'datetime',width:150,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
